package ksj.common;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import bean.Schedules;
import bean.SchedulesPK;

public interface SchedulesRepository extends CrudRepository<Schedules, SchedulesPK> {
	@Query(value = "select task_name, task_type, config_json, variables, message, schedule_type, week_day, month_day, start_time, interval, is_enabled, is_deleted, end_time, id from #{#entityName} where is_deleted = false and is_enabled=true")
	List<Object[]> getAllSchedules();
	
	
	@Query("from Schedules where is_deleted = false and is_enabled=true")
	List<Schedules> listAllSchedules();
}
